﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Carlife.Inf.Migrations
{
    public partial class statement : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "CarMarket",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    MarketName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarketSeries = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Tid = table.Column<int>(type: "int", nullable: true),
                    SalesId = table.Column<int>(type: "int", nullable: true),
                    Marketcard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarketEngine = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarketCreateDate = table.Column<DateTime>(type: "datetime2", nullable: true,defaultValueSql:"getdate()"),
                    MarketUpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    MarketNum = table.Column<int>(type: "int", nullable: true),
                    MarketColor = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false,defaultValue:"False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CarMarket", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Clientdispose",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Servicename = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sclientele = table.Column<int>(type: "int", nullable: true),
                    Aclientele = table.Column<int>(type: "int", nullable: true),
                    Bclientele = table.Column<int>(type: "int", nullable: true),
                    Cclientele = table.Column<int>(type: "int", nullable: true),
                    Dclientele = table.Column<int>(type: "int", nullable: true),
                    Number = table.Column<int>(type: "int", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Clientdispose", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Dictionaries",
                columns: table => new
                {
                    Tid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Tname = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Cname = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Dictionaries", x => x.Tid);
                });

            migrationBuilder.CreateTable(
                name: "Salesperformance",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SalesName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SalesNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Salestype = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SalesMoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Cid = table.Column<int>(type: "int", nullable: true),
                    Clientd = table.Column<int>(type: "int", nullable: true),
                    SaleEnterDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsData = table.Column<bool>(type: "bit", nullable: false, defaultValue: "False"),
                    CreateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()"),
                    UpdateBy = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: true, defaultValueSql: "getdate()")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Salesperformance", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CarMarket");

            migrationBuilder.DropTable(
                name: "Clientdispose");

            migrationBuilder.DropTable(
                name: "Dictionaries");

            migrationBuilder.DropTable(
                name: "Salesperformance");
        }
    }
}
